<?php
	require '../config/config.php';
	$ConfigSql="select * from config where id='1'";
	$ConfigInfo=mysqli_query($con,$ConfigSql);
	$ConnfigRs=mysqli_fetch_array($ConfigInfo);
	session_start();
	if(empty($_SESSION['member'])){
	    echo "<script>location='../../index.php';</script>";
	    exit;
	}
	if($_GET['ops']=="logout"){
	    $_SESSION['member']="";
	    session_destroy();
	    echo "<script>alert('您已退出登录！');location='../index.php';</script>";
	}
?>
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title><?php echo $ConnfigRs['name'];?>-我的订单</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <link rel="stylesheet" href="../css/head.css"/>
  <link rel="stylesheet" href="../layui/css/layui.css">

<link rel="stylesheet" href="../css/global.css">

<script src="../layui/layui.js"></script>
</head>
<body >

<div class="dvhead">
	<div class="dvlogo"><a href="../../../index.php">校园服务反馈系统</a></div>
	<div class="dvreg">
		<?php
		    if(empty($_SESSION['member'])){
                echo "已有账号，立即&nbsp;<a href='login.php'>登录</a>";
            }else{
                echo "欢迎您，".$_SESSION['member']." &nbsp;&nbsp;<a href='?ops=logout'> 退出</a>";
            }
		?>
	</div>
</div>

<div class="main layui-clear">
  <div class="fly-panel" pad20>
    <div class="layui-form layui-form-pane">
        <br />&nbsp;&nbsp;&nbsp;<a href="../index.php">首页</a> / 我的订单<br /><br />
        <table class="news-edit">
		    <?php
		        if(!empty($_GET['id'])){
                	$info=mysqli_query($con,"select * from orderRecord where user='".$_SESSION['member']."'and feedbackid='".$_GET['id']."' order by id asc");
            	}else{
            	    $info=mysqli_query($con,"select * from orderRecord where user='".$_SESSION['member']."' order by id asc");
            	}
	    		while($rs=mysqli_fetch_array($info)){?>
	    		    <tr>
    					<th>订单编号：</th>
    					<td><a href="JavaScript:alert('订单编号：<?php echo $rs['bno'];?>');">查看订单</a></td>
    					<th>生成时间：</th>
    					<td><a href="JavaScript:alert('生成时间：<?php echo $rs['cdate'];?>');">查看时间</a></td>
    					<th>订单状态：</th>
    					<td>
    					    <?php 
    					        if($rs['state']=="-1"){
    					            echo "已作废";
    					        }elseif($rs['state']=="0"){
    					            echo "<font color='red'>待支付</font>";
    					        }elseif($rs['state']=="1"){
    					            echo "已支付";
    					        }elseif($rs['state']=="2"){
    					            echo "挂账";
    					        }else
    					    ?>
    					</td>
    					<th>关联工单：</th>
    					<td><a href="../show.php?id=<?php echo $rs['feedbackid'];?>">查看工单</a></td>
    					<th>订单明细：</th>
    					<td><a href="./order.php?order=<?php echo  $rs['bno'];?>">订单明细</a></td>
    				</tr>   
	    	<?php } ?>
		</table>
    </div>
  </div>
</div>

 <script type="text/javascript" charset="utf-8" src="js/kindeditor.js"></script>
  <script type="text/javascript">
    KE.show({
        id : 'content',
		resizeMode : 1,
        cssPath : './index.css',
        items : [
        'fontname', 'fontsize', 'textcolor', 'bgcolor', 'bold', 'italic', 'underline',
        'removeformat', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
        'insertunorderedlist', 'emoticons', 'image', 'link']
    });
  </script>
<script>

layui.cache.page = '';
layui.cache.user = {
  username: '游客'
  ,uid: -1
  ,avatar: '../res/images/avatar/00.jpg'
  ,experience: 83
  ,sex: '男'
};
layui.config({
  version: "2.0.0"
  ,base: '../res/mods/'
}).extend({
  fly: 'index'
}).use('fly');
</script>
</body>
</html>